combit List & Label 30 - .NET Help
Programming Introduction / Other Important Concepts / Error Handling with Exceptions
Error Handling with Exceptions

List & Label defines a number of internal exceptions, which are all derived from the common base class ListLabelException and therefore can be caught at a central location. If the application is supposed to carry out its own Exception handling, calls to List & Label can be enclosed by an Exception handler. The Message property of the Exception class contains an error text, which – if a corresponding language kit is present – is also generally localized and can be displayed directly to the user:

ListLabel LL = null;
try
{
  LL = new ListLabel();
  LL.DataSource = CreateDataSet();
  LL.Design();
}
catch (ListLabelException ex)
{
  MessageBox.Show(ex.Message);
}
finally
{
  if(LL != null)
    LL.Dispose();
}